import { fromJS } from 'immutable';
import * as actionType from './actionType';

const defaultValue = fromJS({
    hotList: [],
    showBackTop: false
});


export default (state = defaultValue, action) => {
    switch (action.type) {
        case actionType.GET_MORE_DATA:
            return state.set('listData', state.get('listData').concat(state.get('listData')));
        case actionType.SHOW_TOP:
            return state.set('showBackTop', true);
        case actionType.HIDDEN_TOP:
            return state.set('showBackTop', false);
        default:
            return state;
    }
}